home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / PPP.ARJ / TESTPPP.PAS < prev   
Pascal/Delphi Source File  |  1993-11-24  |  3KB  |  111 lines

  1. PROGRAM TestPPP;
  2.  
  3. {
  4.  
  5.   This is a little example program of how to show a picture, created with
  6.   PPPic and PPPal...
  7.  
  8.   (c) Eric van der Staay a.k.a. Magician/Silicon Limited
  9.  
  10.   For questions, bugs (I'm sure there will be some), other routines,
  11.   contact me:
  12.  
  13.                 Eric van der Staay (Magician/SCL)
  14.                 IJweg 133a
  15.                 1161 EV Zwanenburg
  16.                 Holland
  17.                 ++31(0)2907-2039
  18.  
  19.                 Internet addy: StagVl1@Bouw.Tno.Nl
  20.  
  21.   If you spread this program, be sure to include all these files:
  22.  
  23.   PPPIC.EXE     - Picture converter
  24.   PPPAL.EXE     - Palette converter
  25.   TESTPPP.PAS   - Example program
  26.   LOGO.PCX      - Example logo PCX file
  27.   LOGO.PAS      - Example logo PAS picture file
  28.   LOGOPAL.PAS   - Example logo PAS palette file
  29.   PPP.DOC       - Documentation
  30.  
  31. }
  32.  
  33. {$i Logo.Pas}
  34. {$i LogoPal.Pas}
  35.  
  36. Var SegLogo : Word;     { Segment adress of the logo    }
  37.     SegPal  : Word;     { Segment adress of the palette }
  38.     OfsLogo : Word;     { Offset addres of the logo     }
  39.     OfsPal  : Word;     { Offset addres of the palette  }
  40.  
  41. {---------------------------------------------------------------------------}
  42.  
  43. Procedure VideoMode(Mode:Byte);
  44.  
  45. { Change the videomode... }
  46.  
  47. Begin
  48.      Asm
  49.         Mov AH,$00
  50.         Mov AL,mode
  51.         Int $10
  52.      End;
  53. End;
  54.  
  55. {---------------------------------------------------------------------------}
  56.  
  57. Procedure InitPPP;
  58.  
  59. { Initialite picture + palette offsets/segments... }
  60.  
  61. Begin
  62.      SegLogo:=Seg(Logo);
  63.      OfsLogo:=Ofs(Logo)+3;
  64.      SegPal:=Seg(LogoPalette);
  65.      OfsPal:=Ofs(LogoPalette)+3;
  66. End;
  67.  
  68. {---------------------------------------------------------------------------}
  69.  
  70. Procedure Palette(PalSeg,PalOfs:Word);
  71.  
  72. { Initialise the palette... }
  73.  
  74. Begin
  75.      Asm
  76.     Mov AX,PalSeg
  77.     Mov ES,AX
  78.     Mov DX,PalOfs
  79.     Mov AH,$10
  80.     Mov AL,$12
  81.     Mov BX,$0000
  82.     Mov CX,$00ff
  83.     Int $10
  84.      End;
  85. End;
  86.  
  87. {---------------------------------------------------------------------------}
  88.  
  89. Procedure Picture(XPos,YPos,XSize,YSize:Integer; Segment,Offset:Word);
  90.  
  91. { Show the picture... }
  92.  
  93. Var Y : Integer;
  94.     X : Integer;
  95.  
  96. Begin
  97.      X:=XSize+1;
  98.      For Y:=0 To YSize-1 Do
  99.          Move(Mem[SegMent:Offset+(Y*X)],Mem[$A000:XPos+((Y+YPos)*320)],X);
  100. End;
  101.  
  102. {---------------------------------------------------------------------------}
  103.  
  104. Begin
  105.      VideoMode($13);                            { Go to 320x200x256  }
  106.      InitPPP;                                   { Init the segs/offs }
  107.      Palette(SegPal,OfsPal);                    { Set the palette    }
  108.      Picture(57,50,205,53,SegLogo,OfsLogo);     { Display the piccy  }
  109.      Readln;
  110.      VideoMode(3);                              { Back to 80x25x16   }
  111. End.